class Document < ActiveRecord::Base
  belongs_to :image, :class_name => 'Asset'
  has_many :revision do
    def latest
      find :first, :order => 'created_at DESC'
    end
  end
  validates_presence_of :name, :organization, :address, :postal_code, :phone_number, :email, :book_name, :author, :publisher, :published_at, :isbn, :on => :create
end
